#ifndef __VISUAL_DEBUGGER__
#define __VISUAL_DEBUGGER__

class VisualDebugger {
public:
	VisualDebugger();
	~VisualDebugger();
	
	void RenderGrid() const;
	void RenderAxis(int width, int height, const Vec3n& eye, const Vec3n& lookat, const Vec3n& up) const;
	void RenderOrbit(const Vec3n& eye, const Vec3n& lookat) const;
	void RenderCircle(nfloat radius, const Vec3n& color, size_t n = 50) const;
	void RenderCircle(nfloat radius, size_t n = 50) const;

	void AddPoint(const Vec3n& position, const Vec3n& color);
	void AddSphere(const Vec3n& position, const Vec3n& color, nfloat diameter);
	void AddCross(const Vec3n& position, const Vec3n& color, nfloat diameter);
	void AddLineSegment(const Vec3n& positionA, const Vec3n& positionB, const Vec3n& color);
	void AddTriangle(const Vec3n& positionA, const Vec3n& positionB, const Vec3n& positionC, const Vec3n& color);
	void AddTriangle(const std::pair< std::vector<Vec3n>, std::vector<size_t> >& tm, const Vec3n& color);
	void AddTetraHedron(const Vec3n& positionA, const Vec3n& positionB, const Vec3n& positionC, const Vec3n& positionD, const Vec3n& color);
	void AddQuadrilateral(const Vec3n& positionA, const Vec3n& positionB, const Vec3n& positionC, const Vec3n& positionD, const Vec3n& color);
	void AddPath(const std::vector<Vec3n>& path, const Vec3n& color);

	void ClearPoints();
	void ClearSpheres();
	void ClearLineSegments();
	void ClearTriangles();
	void ClearTetraHedra();
	void ClearQuadrilaterals();
	void ClearPaths();
	void ClearCrosss();
	void Clear();

	void Render() const;
private:
	std::vector< boost::tuples::tuple<Vec3n, Vec3n> > point;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, nfloat> > sphere;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, nfloat> > cross;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, Vec3n> > linesegment;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, Vec3n, Vec3n> > triangle;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, Vec3n, Vec3n, Vec3n> > tetrahedron;
	std::vector< boost::tuples::tuple<Vec3n, Vec3n, Vec3n, Vec3n, Vec3n> > quadrilateral;
	std::vector< boost::tuples::tuple< std::vector<Vec3n>, Vec3n> > path;
};

#endif //__VISUAL_DEBUGGER__
